<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="../common/header.jsp"%>

<h1>Questionnaire management </h1>
<hr/>

<h3>All Questionnaire Table <a href="/questionnaire/questiontable/addItem" type="button" class="btn btn-default btn-sm">Add</a></h3>

<!-- 如果列表非空 -->
<c:if test="${!empty list}">
    <table class="table table-bordered table-striped">
        <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Question</th>
            <th>Note</th>
            <th>Operation</th>
        </tr>

        <c:forEach items="${list}" var="item">
            <tr>
                <td>${item.id}</td>
                <td>${item.name} </td>
                <td>${item.question} </td>
                <td>${item.note} </td>
                <td>
                    <a href="/questionnaire/questiontable/showItem/${item.id}" type="button" class="btn btn-sm btn-success">details</a>
                    <a href="/questionnaire/questiontable/updateItem/${item.id}" type="button" class="btn btn-sm btn-warning">modify</a>
                    <a href="/questionnaire/questiontable/deleteItem/${item.id}" type="button" class="btn btn-sm btn-danger">delete</a>

                    <a href="/questionnaire/question/list/${item.id}" type="button" class="btn btn-sm btn-success">question</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</c:if>

<%@ include file="../common/footer.jsp"%>